const webpack = require('webpack')
module.exports = {
    lintOnSave: false,
    publicPath:  process.env.NODE_ENV === 'production' ? '/custom/' : '/',
    devServer: {
        proxy: {
            // '/web/v1/bes/task/be/task': {
            //     target: 'http://be-web-center-test.iflyresearch.com/web/v1/dictionary/dicNameList',
            //     // target: 'http://172.31.194.75/v1/',
            //     changeOrigin: true,
            //     secure: false
            // },
            '/web/v1': {
                // target: 'http://be-web-center-test.iflyresearch.com',
                target: 'http://be-web-center-test.iflyresearch.com',
              // target: 'http://172.31.194.75/v1/',  
                changeOrigin: true,
                secure: false
            },
            '/web/v2': {
                // target: 'http://be-web-center-test.iflyresearch.com',
                target: 'http://be-web-center-test.iflyresearch.com',
                // target: 'http://172.31.194.75/v2/',
                changeOrigin: true,
                secure: false
            },
            '/mark/v1/': {
                // target: 'http://be-mark-center-test.iflyresearch.com',
                target: 'http://be-mark-center-test.iflyresearch.com',
                // target: 'http://172.31.194.75/v2/',
                changeOrigin: true,
                secure: false
            },
            '/mark/v2/': {
                // target: 'http://be-mark-center-test.iflyresearch.com',
                target: 'http://be-mark-center-test.iflyresearch.com',
                // target: 'http://172.31.194.75/v2/',
                changeOrigin: true,
                secure: false
            },
            '/user/v1': {
                // target: 'http://be-user-center-test.iflyresearch.com',
                target: 'http://be-user-center-test.iflyresearch.com',
                // target: 'http://172.31.194.75/v2/',
                changeOrigin: true,
                secure: false
            },
            '/v1/exportData': {
                // target: 'http://be-task-center-test.iflyresearch.com',
                target: 'http://be-web-center-test.iflyresearch.com/web',
                // target: 'http://172.31.194.75/v2/',
                changeOrigin: true,
                secure: false
            },
            '/v1/be/task/batch/export': {
              // target: 'http://be-task-center-test.iflyresearch.com',
              target: 'http://be-web-center-test.iflyresearch.com/web',
              // target: 'http://172.31.194.75/v2/',
              changeOrigin: true,
              secure: false
            },
            '/task/v1/': {
              // target: 'http://be-task-center-test.iflyresearch.com',
              target: 'http://be-task-center-test.iflyresearch.com',
              // target: 'http://172.31.194.75/v2/',
              changeOrigin: true,
              secure: false
          },
            '/custom': {
              // target: 'http://ainote-test.iflyresearch.com/be',
              target: 'http://ainote-test.iflyresearch.com/be',
              // target: 'http://172.31.194.75/v2/',
              changeOrigin: true,
              secure: false
          }
        }
    },
    configureWebpack: {
        plugins: [
            new webpack.ProvidePlugin({
                $: "jquery",
                jQuery: "jquery",
                "windows.jQuery": "jquery"
            })
        ]
    },
    css: {
        extract: process.env.NODE_ENV === 'development' ? false : {
            filename: 'css/[name].[contenthash:8].css',
            chunkFilename: 'css/[name].[contenthash:8].css'
        },
    },
}